Vercel
API ReferenceChats

Create Chat (Streaming)

Creates a new chat with a user message and returns a Server-Sent Events stream. Events include initial chat state, title deltas, content chunk deltas, and final chat state. The response is `text/event-stream`; each event is `data: <JSON>\n\n` where the JSON conforms to ChatStreamEvent.

POST/v2/chats/stream

Usage

TypeScript Example
import { v0 } from 'v0-sdk'const result = await v0.chats.createStream({  message: 'Hello, world!',  type: 'prompt',})console.log(result)

API Signature

Request

Request Body

message: string

The prompt or instruction to send to the model.

systemPrompt?: string

System-level context for the chat, such as frameworks or development environment details.

modelConfiguration?: object

Overrides for the model behavior.

modelId: 'v0-auto' | 'v0-mini' | 'v0-pro' | 'v0-max' | 'v0-max-fast'

Model to use for the generation.

imageGenerations: boolean

Enables image generations to generate up to 5 images per version.

attachments?: object[]

Files or assets to include with the message.

url: string

URL of the attachment.

mcpServerIds?: string[]

MCP server IDs to enable. When omitted, uses default enabled servers.

skillIds?: string[]

Skill IDs (from skills.sh) to attach. Skills provide domain-specific knowledge to the AI. Maximum 3.

type: 'prompt'

Initialize the chat by sending a prompt to the model.

privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'

Visibility setting for the new chat.

title?: string

Title for the new chat.

metadata?: Record<string, string>

Arbitrary key-value data to attach to the chat.

Response (Stream)

The response is a text/event-stream. Each event is data: <JSON>\n\n where the JSON conforms to one of the following event types:

event: 'chat' | 'chat.title' | 'message.parts.chunk' | 'message.usage' | 'error'

A single Server-Sent Events payload emitted by streaming chat endpoints. Each SSE event is data: <JSON>\n\n where the JSON conforms to one of the union members.

id: string

Unique chat identifier.

title?: string

Chat title, if generated.

privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'

Visibility setting of the chat.

createdAt: string

ISO timestamp of when the chat was created.

updatedAt?: string

ISO timestamp of when the chat was last updated.

authorId: string

ID of the user who created the chat.

vercelProjectId?: string

Associated Vercel project ID, if any.

metadata: Record<string, string>

User-defined key-value metadata.

writePermission: boolean

Whether the caller has write access to this chat.

object: 'chat'

Initial and final chat-state event. Emitted once at stream open with the freshly-created chat, and once at stream close with the chat including the completed assistant message.

On this page